<%--
  Created by IntelliJ IDEA.
  User: a8945
  Date: 2019-07-15
  Time: 14:51
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>管理员</title>
    <link rel="stylesheet" href="<%=basePath%>css/bootstrap.min.css">
</head>
<body>
    <div class="container">

    </div>


</body>
<script src="<%=basePath%>js/jquery-3.4.1.min.js"></script>
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<script>
    function connect(){
        if('WebSocket' in window){
            ws = new WebSocket("ws://127.0.0.1:8080/LIIMP/socketServer/admin");
        }
        else{
            alert("该浏览器不支持WebSocket！请更换浏览器重新打开！");
        }
        ws.onmessage = function(evt){
            console.log(evt.data)
        };

        ws.onclose = function (ev) {
            console.log("连接关闭！");
        };

        ws.onopen = function (ev) {
            console.log("连接成功！")
        };
    }
    connect();
</script>
</html>
